package com.java.operator;

/**
 * 自增自减运算[++ --]：符号在前先运算后使用，符号在后先使用后运算
 */
public class Self {
    public static void main(String[] args) {
        int addition = 0;
        System.out.println(addition); // 0
        System.out.println(addition++); // 0
        System.out.println(addition); // 1
        System.out.println(++addition); // 2
        System.out.println(addition); // 2
        
        int subtraction = 0;
        System.out.println(subtraction); // 0
        System.out.println(subtraction--); // 0
        System.out.println(subtraction); // -1
        System.out.println(--subtraction); // -2
        System.out.println(subtraction); // -2
    }
}
